import java.util.Scanner;

public class demo02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[10];
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入第" + (i + 1) + "个数:");
            arr[i] = sc.nextInt();
            for (int j = 1; j < i + 1; j++) {
                if (arr[i] == arr[j - 1]) {
                    i--;
                    System.out.println("你输入了的数值已存在!请重新输入:");
                }
            }
        }
        // 遍历数组
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+"\t");
        }
    }
}
